package com.client.koshercook.server;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/** clean the datastore*/
public class ServerClean extends HttpServlet{
	
	private static final long serialVersionUID = 1617798413242909541L;
	public void doPost(HttpServletRequest req, HttpServletResponse resp)
    throws IOException {

	doLogic();
	}
	public void doGet(HttpServletRequest req,HttpServletResponse res)
	throws IOException {
	doPost( req, res);
	}
	public void doLogic(){

		DataStore.deleteAllRecipes(); //TODO very dangerous to execute!
		DataStore.deleteAllIngredients();
		DataStore.deleteAllIngWithAlters();
		DataStore.delete400RecipeInfos();
		DataStore.deleteAllAccounts();
		IngredientsDB.deleteInstance(); //TODO very dangerous to execute!
//		IngredientsDB.getInstance(); //will add ingredients to DS if it's empty
	}

}
